package com.bm.server.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bm.common.dto.AttentionDto;
import com.bm.server.entity.Attention;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 查询粉丝
 */
public interface AttentionDao extends BaseMapper<Attention>  {
    //查询数据库，返回list集合，查询所有数据，获取单个用户的粉丝总数，并按照粉丝总数倒序排列
    @Select("select uid,count(distinct fansid) fansid from t_attention group by uid order by fansid desc")
    List<AttentionDto> indexSelect();



}
